package com.jeesite.modules.enums;

public enum KcCodeStatusEnum {

    FREE("0", "空闲"),
    SALED("1", "已出售"),
    LOCKED("2", "被锁定");

    private String code;

    private String name;

    KcCodeStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static KcCodeStatusEnum getOfType(String type) {
        KcCodeStatusEnum[] values = KcCodeStatusEnum.values();
        for (KcCodeStatusEnum value : values) {
            if (type.equals(value.getCode())) {
                return value;
            }
        }
        return null;
    }
}
